summaryrefslogtreecommitdiff
path: root/app/api/partners/rfq-last/[id]/response/route.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/api/partners/rfq-last/[id]/response/route.ts')
-rw-r--r--app/api/partners/rfq-last/[id]/response/route.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/api/partners/rfq-last/[id]/response/route.ts b/app/api/partners/rfq-last/[id]/response/route.ts
index 06ace9a0..ef83f4a3 100644
--- a/app/api/partners/rfq-last/[id]/response/route.ts
+++ b/app/api/partners/rfq-last/[id]/response/route.ts
@@ -36,7 +36,7 @@ async function saveFileStream(file: File, filepath: string) {
export async function POST(
request: NextRequest,
- { params }: { params: { id: string } }
+ { params }: { params: Promise<{ id: string }> }
) {
try {
const session = await getServerSession(authOptions)
@@ -44,7 +44,8 @@ export async function POST(
return NextResponse.json({ error: "Unauthorized" }, { status: 401 })
}
- const rfqId = parseInt(params.id)
+ const { id } = await params
+ const rfqId = parseInt(id)
const formData = await request.formData()
const data = JSON.parse(formData.get('data') as string)
const files = formData.getAll('attachments') as File[]
@@ -284,7 +285,7 @@ export async function POST(
export async function PUT(
request: NextRequest,
- { params }: { params: { id: string } }
+ { params }: { params: Promise<{ id: string }> }
) {
try {
const session = await getServerSession(authOptions)
@@ -292,7 +293,8 @@ export async function PUT(
return NextResponse.json({ error: "Unauthorized" }, { status: 401 })
}
- const rfqId = parseInt(params.id)
+ const { id } = await params
+ const rfqId = parseInt(id)
const formData = await request.formData()
const data = JSON.parse(formData.get('data') as string)
const files = formData.getAll('attachments') as File[]